projects
/
xen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
92a80cd
)
libxl: only allow guests with a device model to use cd-{eject/insert}
author
Roger Pau Monne
<roger.pau@citrix.com>
Fri, 8 Apr 2016 16:13:38 +0000
(18:13 +0200)
committer
Ian Jackson
<Ian.Jackson@eu.citrix.com>
Fri, 8 Apr 2016 16:58:02 +0000
(17:58 +0100)
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxl/libxl.c
patch
|
blob
|
history
diff --git
a/tools/libxl/libxl.c
b/tools/libxl/libxl.c
index 91a1dd138458ce6243154783814bb220db1eeb82..d232473523c030b72a013c3b63bf318f30410d42 100644
(file)
--- a/
tools/libxl/libxl.c
+++ b/
tools/libxl/libxl.c
@@
-2913,6
+2913,12
@@
int libxl_cdrom_insert(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk,
goto out;
}
+ if (dm_ver == LIBXL_DEVICE_MODEL_VERSION_NONE) {
+ LOG(ERROR, "Guests without a device model cannot use cd-insert");
+ rc = ERROR_FAIL;
+ goto out;
+ }
+
disks = libxl_device_disk_list(ctx, domid, &num);
for (i = 0; i < num; i++) {
if (disks[i].is_cdrom && !strcmp(disk->vdev, disks[i].vdev))